<div class="col-lg-1"></div>
<div class="col-lg-11">
	<%= form_for(@user) do |f| %>
	  
	  <% if @user.errors.any? %>
	  	<div class="alert alert-danger col-md-9">
	  		<b>Foram encontrados alguns erros:</b><br /> 
	  		<ul>
			      <% @user.errors.full_messages.each do |msg| %>
			        <li><%= msg %></li>
			      <% end %>
	      	</ul>
	  	</div>
	  <% end %>
  
	  <div class="form-group">
	      <label for="name" class="col-sm-9 control-label">Nome</label>
	      <div class="col-sm-9">
	      	<%= f.text_field :name, id: :name, class: 'form-control'%>
	      </div>
	  </div>
  
	  <div class="form-group">
	      <label for="email" class="col-sm-9 control-label">E-mail</label>
	      <div class="col-sm-9">
	      	  <%= f.text_field :email, id: :email, class: 'form-control'%>
	      </div>
	  </div>
  
	  <div class="form-group">
	      <label for="permission" class="col-sm-9 control-label">Permissão</label>
	      <div class="col-sm-9">
	      	<%= f.select :permission, [['Convidado', 'guest'], ['Operador', 'operator', ], ['Administrador', 'admin']], {},{:class=>"form-control"} unless @user == session[:current_user]%>
	      	<%= '<b>Administrador</b>'.html_safe if @user == session[:current_user]%>
	      </div>
	  </div>
  
	  <div class="form-group">
	      <div class="col-sm-9">
	      	<br />
	      	<%= f.submit 'Salvar', :class => 'btn btn-block btn-primary'%>  
	      </div>
	  </div>
<% end %>
</div>